<% item_counter = item_counter || 0 #грязный хак :)
%>
<!-- style="background:<%=++item_counter.modulo(2) == 0 ? "" : "#F0F3F5"%>;" -->
<li id="item_<%=item.id%>" class="item" >
  <div class="control_elements">
    <span class="drag">drag</span>
    <%if !item.todo.nil?%>
      <%=link_to_remote 'В',  { :url => {:controller => :todos, :action => :destroy, :note_id => item.todo.id}, :method => 'delete'}, :href => url_for(:controller => :todos, :action => :destroy, :note_id => item.id), :title => 'убрать чекбокс'%>
    <%else%>
      <%=link_to_remote 'В',  { :url => {:controller => :notes, :action => :create, :note_id => item.id}, :method => 'post'}, :href => url_for(:controller => :notes, :action => :create, :note_id => item.id), :title => 'добавить чекбокс'%>
    <%end%>
    <%=link_to_remote 'И',  { :url => edit_note_url(item), :method => 'get'}, :href => url_for(edit_note_url(item)), :title => 'изменить текс'%>
    <%=link_to_remote 'У',  { :url => note_url(item), :method => 'delete' }, :href => url_for(note_url(item)),:title => 'удалить в корзину',  :method => 'delete'%>
  </div>
  <%if !item.todo.nil?%>
    <%=check_box_tag 'todo', 'done', item.todo.done, :onchange => "{new Ajax.Request('/todos/update', {asynchronous:true, evalScripts:true, method: 'put', parameters:'done=' + escape(checked) + '&todo_id=' + #{item.todo.id} + '&authenticity_token=' + encodeURIComponent('#{form_authenticity_token}') } ) }"%> 
  <%end%>
  <span class="<%=item.todo && item.todo.done ? 'grey_note_text' : 'black_note_text'%>">   <%=h item.text %>    </span>
</li>